package com.mpaster.meego.controller;

import com.mpaster.meego.entity.Role;
import com.mpaster.meego.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Set;

@RestController
@CrossOrigin
public class RoleController {
    @Autowired
    private RoleService roleService;

    @GetMapping("/roles")
    public Set<Role> getRoles(){
        return roleService.findAll();
    }
}
